package com.ate.testday03;

import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * @author Ate
 * @description:
 * @date :2020/11/12 8:10
 */
public class RetrofitFactory {
    private static RetrofitFactory instance;
    private static Retrofit retrofit;
    private RetrofitFactory(){}

    public static RetrofitFactory getInstance(){
        if (instance==null){
            synchronized (RetrofitFactory.class){
                if (instance==null){
                    instance = new RetrofitFactory();
                }
            }
        }
        return instance;
    }

    public void retrofit(){
        retrofit = new Retrofit.Builder().baseUrl("")
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .build();
    }
}
